﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;

using ProjectBase.Core;

namespace Survey.Entity
{
    /// <summary>
    ///     ICodeList represents almost unchanging set of values.
    ///     E.g. Countries, Currencies, Types, Colors.
    ///     In comparison with Enum they are more likely objects - entities
    ///     with uniqe Code and more describing Name. 
    ///     Due to their state, ICodeLists are easy to localize
    ///     and therefore used on UI with approprieate user language dependent value
    /// </summary>
    public interface ICodeList : IPersistentObjectWithTypedId<int>, ISetID<int>
    {
        /// <summary>
        ///     Unique value, distinguishing entity in the list 
        ///     (e.g. 'EUR' fo currency, 'IN' for country
        /// </summary>
        string Code { get; set; }

        /// <summary>
        ///     Name discribing the Code value in the main 
        ///     application language
        /// </summary>
        string Name { get; set; }

        /// <summary>
        ///     Very important switch, allowing to hide not so often used values.
        ///     CodeList can contain all 180 countries, 
        ///     but only few frequently used will be displayed in comboboxes ...
        /// </summary>
        bool IsVisible { get; set; }

        /// <summary>
        ///     Provides the localized version of the Name.
        ///     This property is filled on Facade using GetAll(),
        ///     or in the ComboBox
        /// </summary>
        string Localized { get; }
    }
}